home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / FireMan.swf / scripts / frame_1134 / PlaceObject2_815_88 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2008-09-12  |  2KB  |  82 lines

  1. onClipEvent(enterFrame){
  2.    function doexplode()
  3.    {
  4.       myColor.setTransform(myColorNormal);
  5.       this.gotoAndStop("death");
  6.    }
  7.    function drawframe()
  8.    {
  9.       this.gotoAndStop("standing");
  10.    }
  11.    _X = _X - heroe.scrollspeed;
  12.    _Y = _Y - heroe.vscrollspeed;
  13.    _visible = false;
  14.    hitable = this.hitTest(_parent.mascara);
  15.    if(hitable)
  16.    {
  17.       _visible = true;
  18.       if(this.sprite.hotzone.hitTest(heroe.sprite.hotzone))
  19.       {
  20.          heroe.damage = 2;
  21.          heroe.hitted = true;
  22.       }
  23.       if(this.sprite.hotzone.hitTest(_parent.shoot1) && hitable)
  24.       {
  25.          hitted = true;
  26.          _root.shoot1.impact = true;
  27.          _root.hitted.start();
  28.       }
  29.       if(timerdamage == 0 && hitted)
  30.       {
  31.          timerdamage = FLASHTIME;
  32.          currentdamage += DAMAGE;
  33.       }
  34.       if(timerdamage > 0)
  35.       {
  36.          flashing = true;
  37.          timerdamage % 3 != 0 ? myColor.setTransform(myColorNormal) : myColor.setTransform(myColorTransform);
  38.          timerdamage--;
  39.       }
  40.       if(flashing && timerdamage == 0)
  41.       {
  42.          flashing = false;
  43.          myColor.setTransform(myColorNormal);
  44.          hitted = false;
  45.       }
  46.       if(currentdamage >= MAXDAMAGE)
  47.       {
  48.          myColor.setTransform(myColorTransform);
  49.          death = true;
  50.          delete shoot;
  51.       }
  52.       if(death)
  53.       {
  54.          _root.shoot1.impact = false;
  55.          doexplode();
  56.       }
  57.    }
  58.    if(!death)
  59.    {
  60.       if(idle)
  61.       {
  62.          if(hitable)
  63.          {
  64.             idle = false;
  65.             attack = true;
  66.          }
  67.       }
  68.       if(attack)
  69.       {
  70.          _X = _X - 2;
  71.          rad++;
  72.          _Y = yi + 5 * Math.sin(3.141592653589793 * rad / 20);
  73.          if(_X <= -64)
  74.          {
  75.             attack = false;
  76.             _visible = false;
  77.          }
  78.       }
  79.       drawframe();
  80.    }
  81. }
  82.